package com.example.tao_city.text1;

import android.annotation.SuppressLint;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import static com.example.tao_city.text1.R.color.blue;

/**
 * Created by TAO_CITY on 2018/1/15.
 */

public class Recharge_budeng extends AppCompatActivity implements View.OnClickListener{
    private ImageView back,weixin,yinglain,zhifubao;
    private TextView jiage10,jiage20,jiage30,jiage50,jiage100,jiage200;

    @Override
    protected void onCreate(Bundle save){
        super.onCreate(save);
        setContentView(R.layout.recharge_budeng);
        initbutton();
    }
    private void initbutton(){
        back=findViewById(R.id.recharge_budeng_back);
        jiage10=findViewById(R.id.recharge_budeng_jiage10);
        jiage20=findViewById(R.id.recharge_budeng_jiage20);
        jiage30=findViewById(R.id.recharge_budeng_jiage30);
        jiage50=findViewById(R.id.recharge_budeng_jiage50);
        jiage100=findViewById(R.id.recharge_budeng_jiage100);
        jiage200=findViewById(R.id.recharge_budeng_jiage200);
        weixin=findViewById(R.id.recharge_budeng_weixin);
        yinglain=findViewById(R.id.recharge_budeng_yinglian);
        zhifubao=findViewById(R.id.recharge_budeng_zhifubao);

        weixin.setOnClickListener(this);
        yinglain.setOnClickListener(this);
        zhifubao.setOnClickListener(this);
        jiage10.setOnClickListener(this);
        jiage20.setOnClickListener(this);
        jiage30.setOnClickListener(this);
        jiage50.setOnClickListener(this);
        jiage100.setOnClickListener(this);
        jiage200.setOnClickListener(this);
        back.setOnClickListener(this);
    }


    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.recharge_budeng_back:
                finish();
                break;
            case R.id.recharge_budeng_jiage10:
                setjiagebackground();
                jiage10.setBackgroundResource(R.drawable.recharge_jiageoncli);
                jiage10.setTextColor(Color.parseColor("#458fee"));
                break;
            case R.id.recharge_budeng_jiage20:
                setjiagebackground();
                jiage20.setBackgroundResource(R.drawable.recharge_jiageoncli);
                jiage20.setTextColor(Color.parseColor("#458fee"));
                break;
            case R.id.recharge_budeng_jiage30:
                setjiagebackground();
                jiage30.setBackgroundResource(R.drawable.recharge_jiageoncli);
                jiage30.setTextColor(Color.parseColor("#458fee"));
                break;
            case R.id.recharge_budeng_jiage50:
                setjiagebackground();
                jiage50.setBackgroundResource(R.drawable.recharge_jiageoncli);
                jiage50.setTextColor(Color.parseColor("#458fee"));
                break;
            case R.id.recharge_budeng_jiage100:
                setjiagebackground();
                jiage100.setBackgroundResource(R.drawable.recharge_jiageoncli);
                jiage100.setTextColor(Color.parseColor("#458fee"));
                break;
            case R.id.recharge_budeng_jiage200:
                setjiagebackground();
                jiage200.setBackgroundResource(R.drawable.recharge_jiageoncli);
                jiage200.setTextColor(Color.parseColor("#458fee"));
                break;
            case R.id.recharge_budeng_weixin:
                setzhifuimg();
                weixin.setImageResource(R.drawable.icon_weixin1);
                break;
            case R.id.recharge_budeng_yinglian:
                setzhifuimg();
                yinglain.setImageResource(R.drawable.icon_yinglian1);
                break;
            case R.id.recharge_budeng_zhifubao:
                setzhifuimg();
                zhifubao.setImageResource(R.drawable.icon_zhifubao1);
                break;
        }
    }
    private void setjiagebackground(){
        jiage10.setBackgroundResource(R.drawable.recharge_jiage);
        jiage20.setBackgroundResource(R.drawable.recharge_jiage);
        jiage30.setBackgroundResource(R.drawable.recharge_jiage);
        jiage50.setBackgroundResource(R.drawable.recharge_jiage);
        jiage100.setBackgroundResource(R.drawable.recharge_jiage);
        jiage200.setBackgroundResource(R.drawable.recharge_jiage);

        jiage10.setTextColor(Color.parseColor("#d9d9da"));
        jiage20.setTextColor(Color.parseColor("#d9d9da"));
        jiage30.setTextColor(Color.parseColor("#d9d9da"));
        jiage50.setTextColor(Color.parseColor("#d9d9da"));
        jiage100.setTextColor(Color.parseColor("#d9d9da"));
        jiage200.setTextColor(Color.parseColor("#d9d9da"));
    }
    private void setzhifuimg(){
        weixin.setImageResource(R.drawable.icon_weixin);
        zhifubao.setImageResource(R.drawable.icon_zhifubao);
        yinglain.setImageResource(R.drawable.icon_yinglian);
    }
}
